package com.auto.survey.activity.monitoring.entity.ctrlmeasure

import androidx.room.Embedded
import androidx.room.Junction
import androidx.room.Relation
import com.auto.survey.activity.monitoring.entity.MonitoringPoint

/**
 * 闭合观测序列与测点的组合数据类
 */
data class ClosedLoopWithPoints(
    @Embedded val loop: ClosedLoopObservation,

    @Relation(
        parentColumn = "id",
        entityColumn = "loopId",
        entity = LoopObservationPoint::class
    )
    var points: List<LoopObservationPoint>,

    @Relation(
        parentColumn = "id",
        entityColumn = "id",
        associateBy = Junction(
            value = LoopObservationPoint::class,
            parentColumn = "loopId",
            entityColumn = "pointId"
        )
    )
    var monitoringPoints: List<MonitoringPoint>
)
